<template>
  <text-base
    v-bind="attrs"
    :itemStyle="itemStyleNew"
    trigger="click"
    parentType="other"
    tooltip
    @itemEvent="row => emits('itemEvent', row)"
  ></text-base>
</template>
<script setup>
import TextBase from './TextBase.vue';

const attrs = useAttrs();

const props = defineProps({
  itemStyle: {
    type: Object,
    default: () => ({}),
  },
});

const emits = defineEmits(['itemEvent']);

const itemStyleNew = computed(() => {
  const { emptyValue, row, prop } = attrs;
  return emptyValue && !row[prop]
    ? {}
    : {
        background: '#E9F3F9',
        'border-radius': '4px',
        height: '20px',
        'line-height': '20px',
        color: '#303133',
        display: 'block',
        cursor: 'pointer',
        ...props.itemStyle,
      };
});
</script>
